<template>
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <span>能耗地图</span>
    </div>
    <div class="text item">
      <div id="Map" style="width: 100%;height: 400px"></div>
    </div>
  </el-card>

</template>

<script>
import {getEmissionPercent} from "@/api/dtct/dataCenter";

export default {
  name: "Map",
  mounted() {
    this.initEchart();
  },
  methods: {
   
    initEchart() {
        let myChart = this.$echarts.init(document.getElementById('Map'));

        let option = {
          tooltip: {
            trigger: 'item',
            show: true
          },
            series: [
    {
      type: 'treemap',
      data: [
        {
          name: 'nodeA',
          value: 10,
          children: [
            {
              name: '办公用水量',
              value: 4
            },
            {
              name: '办公耗电量',
              value: 6
            }
          ]
        },
        {
          name: '生产能耗',
          value: 20,
          children: [
            {
              name: '生产耗电量',
              value: 20,
              
            }
          ]
        }
      ]
    }
  ]
        };

        option && myChart.setOption(option);
      }


    }
  
}
</script>

<style scoped>

</style>
